package com.edgardeng.education.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.edgardeng.education.entity.Student;
import com.edgardeng.education.entity.enums.GenderEnum;
import com.edgardeng.education.mapper.StudentMapper;
import com.edgardeng.education.service.IStudentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 学生 服务实现类
 * </p>
 *
 * @author edgardeng
 * @since 2020-04-28
 */
@Service
public class StudentServiceImpl extends ServiceImpl<StudentMapper, Student> implements IStudentService {

    @Override
    public List<Student> getMaleStudents() {
        LambdaQueryWrapper<Student> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(Student::getGenderCode, GenderEnum.MALE);
//        return baseMapper.getPart(wrapper);
        return baseMapper.getPartList(wrapper);
    }
}
